import allure
from selenium.webdriver.common.by import By

from po.page.base_page import BasePage
from po.utils.log_utils import logger


class MainPage(BasePage):
    """首页"""
    _CONTACT_BTN = By.XPATH, '//*[text()="通讯录"]'
    @allure.step("进入通讯录页面")
    def goto_contact(self):
        """
        进入通讯录页面
        :return:
        """
        self.find_ele(*self._CONTACT_BTN).click()
        logger.info("进入通讯录页面")
        from po.page.contact_page import ContactPage
        return ContactPage(self.driver)

    def goto_add_member(self):
        """
        进入添加成员页面
        :return:
        """
        from po.page.add_member_page import AddMemberPage
        return AddMemberPage(self.driver)
